
<?php
if(!isset($deals))
{
	$deals = array();
}
if(!empty($deals))
{
	$currencySymbol = cr("DealConfig.currency_symbol");
	$dealCounter = 0;
	foreach ($deals as $deal)
	{
		$img = $html->image($deal['Deal']['image'], array('alt'=>$deal['Deal']['title'],'thumb'=>cr('Thumbs.listingMed'), 'height'=>cr('Thumbs.listingMed.height'), 'width'=>cr('Thumbs.listingMed.width')));
		$dealCounter++;
		$dealLastClass = "";
		if($dealCounter % 3 == 0)
		{
			$dealLastClass = "last";
		}
		?>
		<div class="deal <?php echo $dealLastClass; ?>">
			<a href="<?php echo $deal['Deal']['viewUrl'];?>" title="<?php echo h($deal['Deal']['title'])?>">
				<div align="center">
					<div class="deal_name">
						<?php echo $deal['Deal']['title'];?>
					</div>
					<div class="image">
						<?php echo $img;?>
					</div> 
				</div>
				<?php //if($deal['Deal']['purchase_link_status']) { ?>
				<div>
					<span class="price fr"><?php 
					$deal['Deal']['finalPrice'] = str_replace(",", "", $deal['Deal']['finalPrice']);
					echo $currencySymbol." ".number_format($deal['Deal']['finalPrice'],2,'.',''); ?></span>
				</div>
				<div class="clear"></div>
				<div class="deal_des" align="center">
					<span style="text-decoration: line-through;"><?php echo $currencySymbol." ".number_format($deal['Deal']['regular_price'],2); ?></span>
				</div>
				<?php //} ?>
			</a>
		</div>
		<?php 
	}
}
?>